<template>
	<Card>
		<template #head>
			<view class="head">
				<text class="left">签名</text>
			</view>
		</template>
		<template #body>
			<view class="sign-wrapper ">
				<Signature v-model="signVal"></Signature>
			</view>

		</template>

	</Card>

</template>

<script>
	import Card from '@/components/card/components/cardBaseWrapper.vue'

	import Signature from '@/components/sign/sin-signature.vue'
	import { uploadBase64 } from '@/apis/common.js'
	export default {
		components: {
			Card,
			Signature
		},

		computed: {

		},

		data() {
			return {
				signVal: '',

			}
		},
		mounted() {

		},
		methods: {
			upSign(fn) {
				console.log('upSign---------------');
				if (!this.signVal) {
					wx.showToast({
						title: '请签名',
						icon: 'error'
					})
					return
				}
				uploadBase64(this.signVal).then((res) => {
					if (fn instanceof Function) {
						fn(res.body)
					}
				})

			},

		}
	}
</script>

<style lang="scss" scoped>
	.sign {

		&-wrapper {
			border: 2rpx dashed #DEE2EE;
			border-radius: 10rpx;
		}

	}
</style>
